home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 July: Mac OS SDK / Dev.CD Jul 96 SDK / Dev.CD Jul 96 SDK2.toast / Development Kits (Disc 2) / QuickDraw GX / Programming Stuff / Sample Code / Typography Samples / Tracking Layout ƒ / QDGX shell.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-04-10  |  3.4 KB  |  127 lines  |  [TEXT/KAHL]

  1. /****************************************************************************/
  2. /*                                                                            */
  3. /*    interfaces for a simple, MULTI-window graphics shell                    */
  4. /*                                                                            */
  5. /*    ©1990 - 1994  Apple Computer, Inc.                                        */
  6. /*    All rights reserved.                                                    */
  7. /*                                                                            */
  8. /****************************************************************************/
  9.  
  10. #include <Desk.h>
  11. #include <Events.h>
  12. #include <Fonts.h>
  13. #include <Windows.h>
  14. #include <Memory.h>
  15. #include <ToolUtils.h>
  16. #include <Menus.h>
  17. #include <Resources.h>
  18. #include <Quickdraw.h>
  19. #include <GestaltEqu.h>
  20. #include <CodeFragments.h>
  21.  
  22. #include "graphics toolbox.h"
  23. #include "graphics routines.h"
  24. #include "graphics libraries.h"
  25. #include "graphics debugging.h"
  26. #include "graphics macintosh.h"
  27. #include "font library.h"
  28. #include "qd library.h"
  29. #include "PrintingMessages.h"
  30. #include "PrintingManager.h"
  31.  
  32.  
  33.  
  34.  
  35. /**\
  36. |**| ---------------------------------------------------------------------
  37. |**| EXTERN GLOBALS
  38. |**| ---------------------------------------------------------------------
  39. \**/
  40. // the following are expected to be initialized by the shell:
  41.  
  42. // QuickDraw GX shell.c:
  43.  
  44. extern Boolean        gQuitting;
  45.  
  46. // the following are expected to be initialized by your code:
  47.  
  48. extern Rect         gWindowQDRect;
  49. extern Str255        gWindowTitle;
  50. extern Boolean        gDebugging;
  51. extern Boolean        gGiveMeValidation;
  52. extern long            gGraphicsHeapSize;
  53.  
  54.  
  55.  
  56. /**\
  57. |**| ---------------------------------------------------------------------
  58. |**| PROTOTYPES
  59. |**| ---------------------------------------------------------------------
  60. \**/
  61.  
  62. // QuickDraw GX shell.c:
  63.  
  64. void    main                    (void);
  65. void     InitToolbox                (void);
  66. void    CheckQuickDrawGX        (void);
  67. OSErr    MyPrintingEventOverride    (EventRecord *event, Boolean filterEvent);
  68. void    EventLoop                (void);
  69. Boolean    IsAppWindow                (WindowPtr wind);
  70. void    MyDoEvent                (EventRecord *event);
  71. void    DoMouseDown                (EventRecord *event);
  72.  
  73. // QDGX shell misc.c:
  74.  
  75. void    DoMenuCommand            (long menuResult);
  76. gxJob    GetDocJob                (WindowPtr);
  77. gxShape    GetDocShape                (WindowPtr);
  78. short    MyStrLength                (char *s);
  79.  
  80. // QDGX shell printing.c:
  81.  
  82. void    SetUpEditMenuRec        (gxEditMenuRecord *);
  83. OSErr    DoFormat                (WindowPtr, gxDialogResult    *);
  84. OSErr    DoPrinting                (WindowPtr);
  85. OSErr    DoPrintOne                (WindowPtr);
  86.  
  87. // routines required by your code
  88. void    DoSetup                    (void);
  89. void    DoDraw                    (WindowPtr wind, Boolean updating);
  90. OSErr    DoCreateNew                (void);
  91. void    DoDispose                (WindowPtr wind);
  92. void    DoIdle                    (WindowPtr wind);
  93. void    DoTeardown                (void);
  94. void    DoClick                    (WindowPtr wind, Point p);
  95.  
  96.  
  97.  
  98. /**\
  99. |**| ---------------------------------------------------------------------
  100. |**| ENUMS
  101. |**| ---------------------------------------------------------------------
  102. \**/
  103. enum dlogIDs {rAboutBoxID=128,rNoQuickDrawGXID=129};
  104.  
  105. enum mbarID {rMenuBar=128};
  106.  
  107. enum menus {mApple=128,mFile,mEdit};
  108.  
  109. enum mApplItems {iAbout=1};
  110. enum mFileItems {iNew=1,iOpen,iClose,iSave,iPageSetup=6,iPrint,iPrintOne,iQuit=10};
  111. enum mEditItems {iUndo=1,iCut=3,iCopy,iPaste,iClear};
  112.  
  113.  
  114. /**\
  115. |**| ---------------------------------------------------------------------
  116. |**| STRUCTS
  117. |**| ---------------------------------------------------------------------
  118. \**/
  119. // This is the structure we use to hold our private data for each window.
  120. // We store a handle to one of these beasties in each window's refCon field.
  121.  
  122. typedef struct
  123. {
  124.   gxJob        docJob;            // print job for this document.
  125.   gxShape    docPage;        // page shape description for this document.
  126. } T_Doc, *TP_Doc, **TH_Doc;
  127.